﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo01
{
    class Program
    {
        static void Main(string[] args)
        {
            
            Console.WriteLine("请输入你需要的方法：1.加法、2.减法、3.乘法、4.除法");
            int key = int.Parse(Console.ReadLine());
            Calculate c;
            switch (key)
            {
                case 1:
                    c = new Addition();
                    break;
                case 2:
                    c = new Subtraction();
                    break;
                case 3:
                    c = new Multiplication();
                    break;
                case 4:
                    c = new Division();
                    break;
                default:
                    Console.WriteLine("请输入正确的序号");
                    c = new Addition();
                    break;
            }
            Test(c);
        }
        public static void Test(Calculate c)
        {
            c.DisplayResult(10, 5);
        }
    }
}
